package com.gxa.modules.deviceManager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.common.utils.PageUtils;
import com.gxa.common.utils.Query;
import com.gxa.modules.deviceManager.entity.EquipmentClassification;
import com.gxa.modules.deviceManager.mapper.EquipmentClassificationMapper;
import com.gxa.modules.deviceManager.service.EquipmentClassificationService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class EquipmentClassificationServiceImpl extends ServiceImpl<EquipmentClassificationMapper, EquipmentClassification> implements EquipmentClassificationService {

    @Override
    public PageUtils queryByPage(Map<String, Object> params) {
        String classifyName = (String)params.get("classifyName");


        IPage<EquipmentClassification> page = this.page(new Query<EquipmentClassification>().getPage(params),
                new QueryWrapper<EquipmentClassification>().like(StringUtils.isNotEmpty(classifyName),"classify_name",classifyName));
        return new PageUtils(page);
    }



}
